/* 全局样式重置 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  width: 100%;
  height: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #333;
  background-color: #f5f5f5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* 通用样式 */
a {
  color: #1890ff;
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: #40a9ff;
}

button {
  cursor: pointer;
  font-family: inherit;
  font-size: inherit;
  border: none;
  outline: none;
  background: none;
}

input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  padding: 8px 12px;
  transition: border-color 0.3s, box-shadow 0.3s;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: #40a9ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

/* 布局组件样式 */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.header {
  width: 100%;
  height: 64px;
  background-color: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
  position: fixed;
  top: 0;
  left: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
}

.content {
  flex: 1;
  padding-top: 64px;
  padding-bottom: 24px;
  background-color: #f5f5f5;
}

.footer {
  width: 100%;
  height: 60px;
  background-color: #fff;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #666;
  font-size: 12px;
}

/* 卡片组件样式 */
.card {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.09);
  padding: 20px;
  margin-bottom: 20px;
  transition: box-shadow 0.3s;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.card-title {
  font-size: 18px;
  font-weight: 600;
  color: #262626;
}

.card-body {
  font-size: 14px;
  color: #595959;
}

.card-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid #f0f0f0;
}

/* 按钮样式 */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
  white-space: nowrap;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  transition: all 0.3s;
  outline: none;
}

.btn-primary {
  color: #fff;
  background-color: #1890ff;
  border-color: #1890ff;
}

.btn-primary:hover {
  background-color: #40a9ff;
  border-color: #40a9ff;
}

.btn-primary:active {
  background-color: #096dd9;
  border-color: #096dd9;
}

.btn-secondary {
  color: #595959;
  background-color: #fff;
  border-color: #d9d9d9;
}

.btn-secondary:hover {
  color: #40a9ff;
  border-color: #40a9ff;
}

.btn-secondary:active {
  color: #096dd9;
  border-color: #096dd9;
}

.btn-success {
  color: #fff;
  background-color: #52c41a;
  border-color: #52c41a;
}

.btn-success:hover {
  background-color: #73d13d;
  border-color: #73d13d;
}

.btn-danger {
  color: #fff;
  background-color: #ff4d4f;
  border-color: #ff4d4f;
}

.btn-danger:hover {
  background-color: #ff7875;
  border-color: #ff7875;
}

.btn-warning {
  color: #fff;
  background-color: #faad14;
  border-color: #faad14;
}

.btn-warning:hover {
  background-color: #ffc53d;
  border-color: #ffc53d;
}

.btn-link {
  color: #1890ff;
  background-color: transparent;
  border-color: transparent;
}

.btn-link:hover {
  color: #40a9ff;
  background-color: rgba(24, 144, 255, 0.08);
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

.btn-sm {
  padding: 4px 12px;
  font-size: 12px;
}

/* 表单样式 */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: #262626;
}

.form-control {
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  line-height: 1.5;
  color: #262626;
  background-color: #fff;
  border: 1px solid #d9d9d9;
  border-radius: 4px;
  transition: border-color 0.3s, box-shadow 0.3s;
}

.form-control:focus {
  border-color: #40a9ff;
  box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
  outline: none;
}

.form-control:disabled {
  background-color: #f5f5f5;
  border-color: #d9d9d9;
  color: #bfbfbf;
  cursor: not-allowed;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* 列表样式 */
.list {
  list-style: none;
}

.list-item {
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}

.list-item:last-child {
  border-bottom: none;
}

/* 表格样式 */
.table {
  width: 100%;
  border-collapse: collapse;
}

.table th,
.table td {
  padding: 12px;
  text-align: left;
  border-bottom: 1px solid #f0f0f0;
}

.table th {
  font-weight: 600;
  color: #262626;
  background-color: #fafafa;
}

.table tr:hover {
  background-color: #fafafa;
}

/* 标签样式 */
.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.tag-primary {
  color: #1890ff;
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
}

.tag-success {
  color: #52c41a;
  background-color: #f6ffed;
  border: 1px solid #b7eb8f;
}

.tag-warning {
  color: #faad14;
  background-color: #fff7e6;
  border: 1px solid #ffd591;
}

.tag-danger {
  color: #ff4d4f;
  background-color: #fff1f0;
  border: 1px solid #ffccc7;
}

/* 徽章样式 */
.badge {
  display: inline-block;
  padding: 0 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  color: #fff;
  background-color: #d9d9d9;
}

.badge-primary {
  background-color: #1890ff;
}

.badge-success {
  background-color: #52c41a;
}

.badge-warning {
  background-color: #faad14;
}

.badge-danger {
  background-color: #ff4d4f;
}

/* 进度条样式 */
.progress {
  width: 100%;
  height: 8px;
  background-color: #f0f0f0;
  border-radius: 4px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background-color: #1890ff;
  transition: width 0.3s;
}

.progress-primary .progress-bar {
  background-color: #1890ff;
}

.progress-success .progress-bar {
  background-color: #52c41a;
}

.progress-warning .progress-bar {
  background-color: #faad14;
}

.progress-danger .progress-bar {
  background-color: #ff4d4f;
}

/* 分隔线样式 */
.divider {
  height: 1px;
  background-color: #f0f0f0;
  margin: 16px 0;
}

/* 加载动画 */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 2px solid #f3f3f3;
  border-top: 2px solid #1890ff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.loading-fullscreen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.loading-fullscreen .loading {
  width: 40px;
  height: 40px;
  border-width: 4px;
}

/* 提示框样式 */
.toast {
  position: fixed;
  top: 64px;
  right: 24px;
  padding: 12px 20px;
  border-radius: 4px;
  background-color: #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  display: flex;
  align-items: center;
  z-index: 1001;
  animation: slideIn 0.3s, fadeOut 0.3s 3s forwards;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to { opacity: 0; transform: translateX(100%); }
}

.toast-success {
  border-left: 4px solid #52c41a;
}

.toast-error {
  border-left: 4px solid #ff4d4f;
}

.toast-warning {
  border-left: 4px solid #faad14;
}

.toast-info {
  border-left: 4px solid #1890ff;
}

.toast-icon {
  margin-right: 12px;
  font-size: 18px;
}

.toast-message {
  flex: 1;
  font-size: 14px;
  color: #262626;
}

/* 模态框样式 */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  animation: fadeIn 0.3s;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-content {
  background-color: #fff;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  animation: slideUp 0.3s;
}

@keyframes slideUp {
  from { transform: translateY(50px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 600;
  color: #262626;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* 抽屉样式 */
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 360px;
  height: 100%;
  background-color: #fff;
  box-shadow: -2px 0 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
  transform: translateX(100%);
  transition: transform 0.3s;
  display: flex;
  flex-direction: column;
}

.drawer.open {
  transform: translateX(0);
}

.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.drawer.open + .drawer-backdrop {
  opacity: 1;
  pointer-events: auto;
}

.drawer-header {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.drawer-title {
  font-size: 16px;
  font-weight: 600;
  color: #262626;
}

.drawer-body {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.drawer-footer {
  padding: 16px 20px;
  border-top: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .header {
    padding: 0 16px;
  }
  
  .content {
    padding-top: 56px;
    padding-bottom: 16px;
  }
  
  .card {
    padding: 16px;
    margin-bottom: 16px;
  }
  
  .container {
    padding: 0 16px;
  }
  
  .btn {
    padding: 8px 12px;
  }
  
  .btn-lg {
    padding: 10px 20px;
    font-size: 14px;
  }
  
  .modal-content {
    width: 95%;
  }
  
  .drawer {
    max-width: 100%;
  }
}

@media (max-width: 480px) {
  .header {
    height: 56px;
  }
  
  .content {
    padding-top: 56px;
  }
  
  .footer {
    height: 50px;
    font-size: 11px;
  }
  
  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  
  .card-title {
    font-size: 16px;
  }
  
  .form-group {
    margin-bottom: 12px;
  }
  
  .table th,
  .table td {
    padding: 8px;
    font-size: 12px;
  }
  
  .modal-header,
  .modal-body,
  .modal-footer {
    padding: 16px;
  }
  
  .drawer-header,
  .drawer-body,
  .drawer-footer {
    padding: 16px;
  }
}

/* 打印样式 */
@media print {
  .header,
  .footer,
  .btn,
  .loading,
  .toast,
  .modal,
  .drawer {
    display: none !important;
  }
  
  .content {
    padding-top: 0;
    background-color: #fff;
  }
  
  .card {
    box-shadow: none;
    border: 1px solid #ddd;
    page-break-inside: avoid;
  }
}